package spring2;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanScope {

	public static void main(String[] args) {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		
		BeanScope bean1 = (BeanScope) context.getBean("beanScope1");
		BeanScope bean2 = (BeanScope) context.getBean("beanScope1");
		BeanScope bean3 = (BeanScope) context.getBean("beanScope2");
		BeanScope bean4 = (BeanScope) context.getBean("beanScope2");

		System.out.println("bean1 == bean2:" + (bean1 == bean2));
		System.out.println("bean2 == bean3:" + (bean1 == bean3));
		System.out.println("bean3 == bean4:" + (bean3 == bean4));

	}

}
